var React = require('react');
var ReactDOM = require('react-dom');
import {Router,Route,IndexRoute,hashHistory} from 'react-router';
import {Provider} from 'react-redux'
import store from './../../store/index'

//blogs
import HeaderLink from "./public/headerLink.js"
import Home from './home.js';
import Essay from './essay.js';

//详情页
import Detail from './detail.js'


var ProductBox = React.createClass({
    render: function() {
        return (
          <Provider store={store}>
            <Router history={hashHistory}>
              <Route path='/' onlyActiveOnIndex component={HeaderLink}>
                  <IndexRoute component={Home}/>
                  <Route path='/essay' component={Essay}/>
                  <Route path='/:moon/:day/:year/:title' component={Detail}/>    
              </Route>
            </Router>
          </Provider>
        )
    }
})

module.exports = ProductBox;